import request from '@/utils/request'

// 获取一级分类接口
// GET /admin/product/getCategory1
export function getCategory1(){
    return request({
        url:'/admin/product/getCategory1',
        method:'GET'
    })
}

// 获取二级分类接口
// GET /admin/product/getCategory2/{category1Id}
export function getCategory2(category1Id){
    return request({
        url:`/admin/product/getCategory2/${category1Id}`,
        method:'GET'
    })
}

//获取三级分类接口
//GET /admin/product/getCategory3/{category2Id}
export function getCategory3(category2Id){
    return request({
        url:`/admin/product/getCategory3/${category2Id}`,
        method:'GET'
    })
}
// 获取商品的属性与属性值
// GET /admin/product/attrInfoList/{category1Id}/{category2Id}/{category3Id}
export function attrInfoList(ids){
    return request({
        url:`/admin/product/attrInfoList/${ids.category1Id}/${ids.category2Id}/${ids.category3Id}`,
        method:'GET'
    })
}

// 添加属性与属性值接口
// POST /admin/product/saveAttrInfo
export function saveAttrInfo(data){
    return request({
        url:'/admin/product/saveAttrInfo',
        method:'POST',
        data
    })
}

// 删除属性接口
// DELETE /admin/product/deleteAttr/{attrId}
export function deleteAttr(attrId){
    return request({
        url:`/admin/product/deleteAttr/${attrId}`,
        method:'DELETE'
    })
}